<include file="Public:header"/>

<div style="width:845px;float:left;margin-left:10px">
<textarea name="tpl" cols="100" rows="25">{$tpl.tpl}</textarea>
</div>
<div style="width:100px;float:left;margin-left:10px">
<br>
<input type="button" name="save" style="width:100px;padding:3px" value="保存修改"><br><br>
<a href="#view2">查看效果</a>
</div>
<input type="text" id="type" value="{$tpl.type}" style="display:none">
<br>
<a name="view2" id="my"> &nbsp; </a>
<div id="view" style="border:2px solid #dedede;width:930px;padding:5px;margin:0 auto;">
预览效果:<br>
{$tpl.tpl}
</div>



<script src="__APP__/statics/webox/webox.js"></script>
<link href="__APP__/statics/webox/jquery-webox.css" rel="stylesheet" type="text/css">
<script>

$('[name=save]').click(function(){
    var type=$("#type").val();
	var tpl=$("[name=tpl]").html();
	$.ajax({
	      type:"POST",
		  url:"__URL__/email_tpl/?action=save",
		  dataType:"json",
		  data:{'type':type,'tpl':tpl},
		  success:function(data){
		  location.reload();
		  }
	})

});
</script>